<%@ include file="/common/taglibs.jsp" %>

<head>
    <title><fmt:message key="userList.title"/></title>
    <meta name="menu" content="AdminMenu"/>
</head>

<c:if test="${not empty searchError}">
    <div class="alert alert-danger alert-dismissable">
        <a href="#" data-dismiss="alert" class="close">&times;</a>
        <c:out value="${searchError}"/>
    </div>
</c:if>
<section class="content-header">
    <h1>
        <fmt:message key="userList.heading"/>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i><fmt:message key="userList.heading"/></a></li>
        <li class="active"> <fmt:message key="userList.heading"/></li>
    </ol>
</section>
<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <%@ include file="/common/messages.jsp" %>
            <div class="box">
                <div class="box-header">

                </div><!-- /.box-header -->
                <div class="box-body">

                    <div id="actions" class="btn-group">
                        <a class="btn btn-primary" href="<c:url value='/userform?method=Add&from=bankadmin'/>">
                            <i class="icon-plus icon-white"></i> <fmt:message key="button.add"/></a>

                        <a class="btn btn-default" href="<c:url value='/home'/>">
                            <i class="icon-ok"></i> <fmt:message key="button.done"/></a>
                    </div>

                    <display:table name="userList" cellspacing="0" cellpadding="0" requestURI=""
                                   defaultsort="1" id="users" pagesize="25" class="table table-condensed table-striped table-hover" export="true">
                        <display:column property="username" escapeXml="true" sortable="true" titleKey="user.username" style="width: 20%"
                                        url="/userform?from=bankadmin" paramId="id" paramProperty="id"/>
                        <display:column property="name" escapeXml="true" sortable="true" titleKey="activeUsers.name"
                                        style="width: 20%"/>
                        <display:column sortable="false" titleKey="user.roles"
                                        style="width: 20%; padding-left: 15px" media="html">
                            <c:forEach var="role" items="${users.roleList}" varStatus="status">
                                <fmt:message key="${role.label}"/><c:if test="${!status.last}">,</c:if>
                            </c:forEach>
                        </display:column>
                        <display:column property="email" sortable="true" titleKey="user.email" style="width: 20%" autolink="true"
                                        media="html"/>
                        <display:column property="email" titleKey="user.email" media="csv xml excel pdf"/>
                        <display:column sortProperty="enabled" sortable="true" titleKey="user.enabled"
                                        style="width: 15%; padding-left: 15px" media="html">
                            <input type="checkbox" disabled="disabled" <c:if test="${users.enabled}">checked="checked"</c:if>/>
                        </display:column>
                        <display:column property="enabled" titleKey="user.enabled" media="csv xml excel pdf"/>

                        <display:setProperty name="paging.banner.item_name"><fmt:message key="userList.user"/></display:setProperty>
                        <display:setProperty name="paging.banner.items_name"><fmt:message key="userList.users"/></display:setProperty>

                        <display:setProperty name="export.excel.filename" value="User List.xls"/>
                        <display:setProperty name="export.csv.filename" value="User List.csv"/>
                        <display:setProperty name="export.pdf.filename" value="User List.pdf"/>
                    </display:table>

                </div>
                </div>
                </div>
        </div>
    </section>

